<?php
session_start();
$queId = $_POST["queId"];
$txtAnswer = $_POST["txtAnswer"];
$currentTime = date ("Y-m-d H:i:s");
$uId = $_SESSION['UserId'] ;

$sql = "INSERT INTO answer (questionId,Answer,ByUserId,CreationTime) 
VALUES ($queId,'$txtAnswer',$uId,'$currentTime')";

require 'database.php';

mysql_query($sql);

mysql_close();
header("location:ViewQuestion.php?quId=$queId");

?>